class Solution:
    def searchInsert(self, nums,  target: int) -> int:
        if not nums: return 0
        if target <= nums[0]: return 0
        if target > nums[-1]: return len(nums)
        for i in range(0, len(nums)-1):
            if nums[i] <= target and nums[i+1]>= target:
                return i+1

if __name__ == '__main__':
    s = Solution()
    # L, t = [1, 3, 5, 6], 5
    # L, t = [1, 3, 5, 6], 2
    # L, t = [1, 3, 5, 6], 7
    # L, t = [1, 3, 5, 6], 1
    # L, t = [1, 3, 5, 6], 0
    # L, t = [], 0
    L, t = [1, 3], 3
    result = s.searchInsert(L, t)
    print(result)